{include file='common/head'}
  <body>
    <div class="x-body layui-anim layui-anim-up">
	    <form class="layui-form" method="post" action="{:url('admin/user/tixianreason')}" enctype="multipart/form-data">
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
                  <span class="x-red">*</span>拒绝原因
              </label>
              <div class="layui-input-inline">
				  <input type="text" id="txt" name="w_reason" required="" lay-verify="required"lay-verify="pass"
                  autocomplete="off" class="layui-input">
              </div>
          </div>
		   <input type="hidden" name="wid" value="{$wid}">
          <div class="layui-form-item">
              <label for="L_repass" class="layui-form-label">
              </label>
			  <button  class="layui-btn" lay-filter="erro" lay-submit="">
                提交
            </button>
          </div>
      </form>
    </div>
    
<script>
	 layui.use(['form','layer'], function(){
        $ = layui.jquery;
        var form = layui.form
            ,layer = layui.layer;

        //自定义验证规则
        //监听提交
        form.on('submit(erro)', function(data){
            //console.log(data);
            //var url="";
            $.ajax({
                type: "post",
                async:false,
                url: "{:url('admin/user/tixianreason')}",
                data: data.field,
                success:function(msg){
					if(msg==1){
						//发异步，把数据提交给php
						layer.msg("操作成功！", {icon: 6,time:1000},function () {
							// 获得frame索引
                                var index = parent.layer.getFrameIndex(window.name);
                                //关闭当前frame
                                parent.layer.close(index);
                                window.parent.location.reload();//刷新父级窗口
						});
					}else{
					    layer.msg("操作失败！",{icon:1,time:1000});
					}
				}
        })
            return false;
        });


    });
     function validateForm()
	{
	  var x=document.getElementById("mon").value;
	   if(isNaN(x)){
			layer.alert("请输入数字");
	   }
	   
	}

</script>

  </body>

</html>